package cn.yerly.sakura.repository;

import cn.yerly.sakura.domain.UserAddress;
import org.springframework.data.jpa.repository.*;

import java.util.List;

/**
 * Spring Data JPA repository for the UserAddress entity.
 */
public interface UserAddressRepository extends JpaRepository<UserAddress,Long> {

    @Query("select userAddress from UserAddress userAddress where userAddress.user.login = ?#{principal.username}")
    List<UserAddress> findAllForCurrentUser();

}
